function sendRequest() {
  // Content-Type: application/json
  fetch('http://127.0.0.1/api/post/json', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: '张智琦',
      age: 18
    })
  })
    .then(res => res.text())
    .then(data => {
      console.log(data)
    })
    .catch(err => {
      console.log(err)
    })
}
